<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <!-- import CSS -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <style>
        #index-header, #index-footer {
            background-color: #B3C0D1;
            color: #333;
            text-align: center;
            line-height: 60px;
        }

        #index-main {
            min-height: calc(100vh - 196px);
            height: calc(100vh - 196px);
            padding: 5px;
        }

        #index-aside {
            min-height: calc(100vh - 86px);
            height: calc(100vh - 86px);
            border-right: solid 1px #e6e6e6;
        }
    </style>
</head>
<body>
<div id="app">
    <el-container>
        <el-header id="index-header">
            <el-container>
                <div style="width: 200px;">hello</div>
                <div>
                    <el-link icon="el-icon-s-fold" style="font-size: 40px;"></el-link>
                    Header
                </div>
            </el-container>
        </el-header>
        <el-container>
            <el-aside id="index-aside" width="220px">
                <el-menu :default-openeds="['1']" style="border-right:none;">
                    <el-submenu index="1">
                        <template slot="title"><i class="el-icon-message"></i>导航一</template>
                        <el-menu-item-group>
                            <template slot="title">分组一</template>
                            <el-menu-item index="1-1" v-on:click="openContent('/foo')"> Go to Foo</el-menu-item>
                            <el-menu-item index="1-2">
                                <router-link to="/bar">Go to Bar</router-link>
                            </el-menu-item>
                        </el-menu-item-group>
                        <el-menu-item-group title="分组2">
                            <el-menu-item index="1-3">
                                <router-link to="/main">Go to Main</router-link>
                            </el-menu-item>
                        </el-menu-item-group>
                        <el-submenu index="1-4">
                            <template slot="title">选项4</template>
                            <el-menu-item index="1-4-1">选项4-1</el-menu-item>
                        </el-submenu>
                    </el-submenu>
                    <el-submenu index="2">
                        <template slot="title"><i class="el-icon-menu"></i>导航二</template>
                        <el-menu-item-group>
                            <template slot="title">分组一</template>
                            <el-menu-item index="2-1">选项1</el-menu-item>
                            <el-menu-item index="2-2">选项2</el-menu-item>
                        </el-menu-item-group>
                        <el-menu-item-group title="分组2">
                            <el-menu-item index="2-3">选项3</el-menu-item>
                        </el-menu-item-group>
                        <el-submenu index="2-4">
                            <template slot="title">选项4</template>
                            <el-menu-item index="2-4-1">选项4-1</el-menu-item>
                        </el-submenu>
                    </el-submenu>
                    <el-submenu index="3">
                        <template slot="title"><i class="el-icon-setting"></i>导航三</template>
                        <el-menu-item-group>
                            <template slot="title">分组一</template>
                            <el-menu-item index="3-1">选项1</el-menu-item>
                            <el-menu-item index="3-2">选项2</el-menu-item>
                        </el-menu-item-group>
                        <el-menu-item-group title="分组2">
                            <el-menu-item index="3-3">选项3</el-menu-item>
                        </el-menu-item-group>
                        <el-submenu index="3-4">
                            <template slot="title">选项4</template>
                            <el-menu-item index="3-4-1">选项4-1</el-menu-item>
                        </el-submenu>
                    </el-submenu>
                </el-menu>
            </el-aside>
            <el-container>
                <el-header style="border-bottom: solid 1px #e6e6e6;  line-height:40px;text-align: center;"> asdfasdf
                </el-header>
                <el-main id="index-main">  <!-- 路由出口 -->
                    <!-- 路由匹配到的组件将渲染在这里 -->
                    <router-view></router-view>
                </el-main>
                <el-footer id="index-footer">Footer</el-footer>
            </el-container>
        </el-container>
    </el-container>
</div>
</body>
<!-- import Vue before Element -->
<!--<script th:src="@{/vue/libs/vue.js}"></script>-->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<!--<script th:src="@{/vue/libs/elementui.js}"></script>-->
<!-- 引入组件库 -->


<script th:src="@{/vue/libs/http-vue-loader.js}"></script>
<script th:src="@{/vue/libs/vue-router.js}"></script>
<script th:src="@{/vue/router/router.js}"></script>

<script>
    var app = new Vue({
        el: '#app',
        router,
        methods: {
            openContent(url) {
                router.push(url).then((data) => {
                    console.log('finish', data);
                }).catch((error) => {
                    console.log(error)
                })
            },
        }
    });

</script>
</html>